My Tacoma indicates codes p0325 and p0336 and it loses power when starting and after a while, it suddenly develops. I've already changed the crankshaft sensor, candles and wiring but it is still the same.
Each of the cylinder's compression should be checked, as it sometimes happens that a piston ring breaks and it produces the failures you are talking about.