Could be a wheel speed sensor connection, but I think that would throw an ABS code. Not sure. I think your loss of throttle is probably the truck going into limp mode. That would surely throw a code I would think. Take it to a free scanner place (autozone) Some scanners read deeper than others. I don't know the cost of these sensors but it sounds like money out the door if they are not bad.
Just my opinion.
Just my opinion.