The throttle position sensor may be a cause of your engines misfire if it's not getting the correct fuel to Air mixture ratio.
However I would take the vehicle to Autozone or another shop and have then run a test on the engines computer to determine the exact cause before spending the money replacing the throttle position sensor since it's unlikely the cause of the engine misfiring.
The throttle position sensor is part of your vehicle's fuel management system, and helps ensure that the correct mixture of air and fuel is delivered to your engine.
But things that could be causing your engine to misfire are faulty spark plugs, bad spark plug wires, low fuel pressure, dirty or clogged fuel injectors or engine compression problems.
A failing or even dirty MAF sensor could cause the vehicle to get a lean code and lean fuel mixture would could cause an engine misfire.
Autozone will test the vehicle for free to determine the problem but your vehicles check engine light needs to on for their tester to work.