Why were you holding down the gas pedal? Was it dying and not idling or something? What does it do when it's idling?
If you're talking about that fluctuation at 1500 rpm and you weren't holding down the gas pedal while it was happening, replace your
TPS (throttle position sensor). The P0300 code indicates a random misfire, but take care of that TPS first.
Make sure it isn't unplugged or something goofy before you do, of course

It's mounted to the side of the throttle body.
You'll need to follow the adjustment procedure as described in the FSM when you install the replacement.
EC-109 has the steps for that. The EC section also has troubleshooting steps on the TPS in general if you want to do that before dropping the change for a new one.