It must be Air Flow Meter, which is placed in air filter neck in between air filter and engine intake manifold. And symptom you said is often caused by that sensor going crazy or 90% of the time lose, I tied mine with a cable tie and never experience any problem.
ICV job is exactly what it says - IDLE CONTROL VALVE so it literally controls the idle RPM and if it's not working either idle RPM will drop below 600 rpm and stall the car or it will increase to waste a lot of fuel while in idling or it will result in dancing RPM from 600 - 1200 range - that's what it used to happen with me.
If your Idle is stable with and without AC, then your ICV is fine, so don't waste money. In Pajero, ideal idle should be around 700-750 rpm without AC and 900-950 rpm with AC. If yours is well within this range then you are fine.