Crank sensor is going south on you.
Did you by chance dunk your jeep in some deep water?
Sounds like if you did you got the CPS wet and possibly some of the other components under the hood.
I'd replace the CPS and go from there.
97 Sahara, 74 Renegade, 72 CJ5, 55 Willy's (the Beast) Boss 302, 6:34 gearing, Bose 901 speakers.
God I miss that Jeep. Forgot the kinda Jeep, 80 SX4.