You'll likely need to replace the throttle position sensor in the 2008 dodge avenger if it's throwing codes, but there's a way you can try to reset it, instead, at least to see if it's a gremlin. put your key into the ignition and turn it on, but refrain from actually starting the vehicle. wait for all the lights to go out; it's expected the check engine light (cel) may remain illuminated. slowly press down on the accelerator pedal until it's all the way down to the floor, and then slowly release it until it's all the way back up in the resting position. turn off the ignition. now, start the engine normally, and see if the engine properly throttles when pressing down on the accelerated and if the cel has gone out. if you previously disconnected your battery, the above method may be all you need to effect a tps reset.
The 2008 dodge avenger throttle position sensor is located on the throttle body that is positioned on the right side of the engine under the air filter housing.