Get a real Factory Service Manual worth its weight in gold. Haynes manuals and other assorted aftermarket manuals aren't even good for whipping your :bootywith much less working on a vehicle.
I assume you can take out two bolts and remove an electrical connector so I'll skip that part.
From FSM, Page 6E3-C1-14.
1. With throttle valve in the normal closed idle postion, install throttle position sensor on throttle body assembly, making sure TP sensor pickup lever lines up with tang on throttle actuator lever.
Put in your bolts and you are done.
The TP Sensor Learn Procedure does require a Tech 1, however, I know my car had one put on before I owned it because previous owner gave me a receipt for a shop that put it on. I do not know if they used a Tech to relearn the TP or not. Being a independent garage at which it was done I doubt it.
FSM states in relation to TP Learn..."this is necessary to ensure effective engine torque reduction during ASR events."
I know my ASR works and so does the engine torque reduction portion of it. I have used it many times. Sometimes when I did not want too...
However, you can check you TP sensor for proper voltage range to ECM. At closed throttle voltage approx. .5volts at WOT it should be near 5V. This should be linear from closed to open no jumping around or a loss of voltage reading. Nice and smooth increase in voltage.
Your gray wire is 5V reference from ECM, Black wire is sensor ground. The Dark Blue one is the one to back probe with your digital meter, it is the TP Sensor signal wire.
If you do not have a meter get a cheap one at Harbor Freight, they work fine, you just have to know how to use it. If you do not have a back probe make one. Some 16 gauge wire, a needle, a wire stripper, and soldiering gun is all it takes.
Back probing is taking the needle/wire and sticking up the backside of the connector with it connected to the sensor. Do this from harness side of connector.
I know I just threw a ton of crap at you, but hope this helps.
FYI, it is usually much cheaper to diagnosis stuff, than throw parts at it.
A guy learned this the hard way, the other day. He bought a 200 dollar power window switch because his drivers side window did not go up or down. He put it in himself and then when it did not work he brought it to us. Well, it took me about 10 mins. to tell him (after thoroughly testing the circuit) his window motor was bad and he f-ed up his pins in his connector to the window switch, when he put in his switch. They where loose as a goose, luckily for him I was able to repair the connector. I put in a window motor and wow, it works. Funny stuff.