96 Dakota SLT idles rough & stalls

So I have a 96 Dodge Dakota SLT 3.9 4WD. Anyway, it idles relatively smoothly at about 700 RPM in drive or neutral, but if I’m in a moving gear and need to stop, the idle is extremely rough. Usually, the RPM’s will drop to near 0 within about 20 seconds of coming to a stop. It will typically recover and continue with rough idling and near stalling a few times, but within a minute or two it stalls. A few additional details: it starts right up again after falling, it doesn’t make any difference if I start it cold and drive immediately or drive it for an hour before coming to a stop, the same thing happens. Anything that looked suspicious to me has been changed (drivebelt, spark plugs & wires, distributor cap & rotor, pcv valve, idle air control valve, and, of course, the air freshener). Any ideas?

I assume you mean you changed the air filter, not the air “freshener.”

Is the check engine light on? If so then you need to get the error codes read. Many auto parts stores do this for free. If you get any error codes report the exact codes (like “P1234”)

Other than that, check the fuel pressure, clean your MAF sensor and throttle body (did you check the IAC valve ports to see that they’re clear?), and check it for vacuum leaks.