Classic symptoms of a failing PCM/ECM/SMEC. Engine computer.
Or a bad ECM ground, or hot power lead to it, or excessive water in the connector to the ECM.
Goto
www.rockauto.com and lookup your year and model and look at the photos.
It is on the firewall up top on the passenger side.
If there is any doubt which one you might have, you should open it up and look for a model number somewhere on the circuit board(s).