I'm assuming you've checked out the plugs and they're ok. I'm also assuming it's been tuned up before (plugs, wires, cap, etc.)
what I'd do is check for codes. do the ON OFF ON OFF trick. if I remember correctly, YJ's do indeed self diagnose.
couple things in my head right now on what's your culprit. crankshaft sensor, dirty injectors, or a bad fuel filter.
check those codes and see what she tells you, then tell us.