2000 Nissan Altima Idle speed too low/rough

My wife’s 2000 Nissan Altima has 92300 miles on it. It has developed a rough idle that seems low-about 700 on the tachometer. It is a manual 5 speed transmission. When you start tha car it runs fine for a couple of minutes, then the idle drops and it starts running rough. There had been a bit of a power loss so I replaced the plugs/wires/cap/rotor-all with OEM OR HIGH QUALITY/PERFORMANCE PARTS. Now the car runs better except for the idle issue. I noticed what seemed to be too much slack in the throttle cable-about 1/2" of deflection. If I tighten it to zero deflection or taut then the engine revves at around 1200RPM. If I adjust the cable to even a tiny bit of shack, the rough idle returns. Happens only when warm.

ALSO!! can any one tell me where the loose plug from the alternator goes? THere is about 8" of haarness that is hanging loose and I can’t find a connector that it goes to! The car does not have AC so it may be meant for that, but I don’t know.

For the rough idle I would look for vacuum leaks and clean the Idle Air Control valve along with its electrical connector.

I would also check the air filter and clean the Mass Airflow Sensor (MAF) while doing it.

I can’t say about the stray plug near the alternator.

Rough Idle turned out to be a leaking intake manifold. With a serpintine belt and tuneup ended up being around $1100.