Here's tony's post deon another thread:
In your case I have a feeling the VCT solenoid took a crap. I would try replacing it and see if it fixes it. Pretty easy to do. All you have to do is take the valve cover off and remove the small bolt holding the solenoids in.
If you want to test the solenoid, run engine at hot idle. When the engine is running like crap, backprobe a ground wire into the variable camshaft solenoids (located at the top of each valve cover) at the following wires one at a time. Only tap the ground to the wire briefly though as holding it there to long can burn it up.
- Driver's side, Violet and Light Blue wire.
- Passenger side, Dark Green and Orange wire.
If tapping a ground to either solenoid changes it, the solenoid was stuck open. Either because of debris stuck in the solenoid or because the solenoid itself was stuck/bad.
Also try disconnecting the cam sensors while running and see if there is any changes.