2004 ranger 3.0 occasional "no power" when starting from a stop??

Hello, hope someone can help. I recently bought a 2004 ranger 3.0 4x4 with 200K. good shape, looks well maintained. One big problem, hope someone will recognize it and help me out ! I am certainly not a genius but i have some experience and been technical all my life. (did i mention "not a genius"?).

PROBLEM is: every once in a while, when pulling away from a stop, the throttle pedal goes limp and engine will not rev up much beyond idle, maybe 5mph top speed. After about 15 seconds, throttle control comes back and engine returns to normal power! Only happens (so far) when engine at operating temperature and when leaving a stop.

It does have a rough idle when hot and has relatively low compression on #4, but it runs down the road smooth at 70 mph and gets 16 mpg on mixed roads.
In process of working on rough idle I have replaced (with new parts) plugs, wires, coil pack, MAP sensor, Idle air bypass, air filter. (runs better but still rough and still has the "limp mode" problem.

Only codes i get are 0304 (misfire #4), and 0300 and 0316 (general misfire) - which i can live with, but the unexpected lack of power on takeoff could be a problem.

I would love it if someone has a fix!!
thanks, Leonard