Disconnecting the connector (1) throttle position sensor (2), measure the resistance between terminals 1 and 4 of the connector on the side of the sensor, which should be 3.5-6.5 kOhm.
Measure the resistance between pin 2 and 4 of the sensor side connector. When slowly opening the throttle from fully closed to fully open, the resistance should change in proportion to the throttle opening angle.
If the resistance does not meet the required values, or does not change smoothly, then replace the throttle position sensor.