Q: car idle up and down on 2001 Nissan Maxima

Rookie cbe0621eac06868b3efe0d8d1d3611e23c60d3114864ea2ec19a68cfbd3eebab
hi i changed the spark plug and replaced the boot for the spark plug and my car started idling up and down. At first it was calling for the mass air flow sensor so i replaced that but the car still idle up and down so had another diagnostic test and this time it was calling for the crankshaft sensor so i replace that and the car is still idling up and down has anyone had this problem and was able to fix it
(2) Answers
(4) Comments
Idling up and down is usually the result of a sticking idle control valve...or possibly due to a vacuum leak.

What code occurred that suggested to replace the MAF?
I'm not seeing a P1226 in the manual for this car.

The P0158 is a catalyst monitor (after cat) oxygen sensor issue.

I'm just not seeing where the MAF had to be replaced from your codes or information. The P0158 would not in any way indicate a MAF issue. Just trying to understand your issues fully...
P1126 - vehicle has not warmed up enough at time of test; could be normal, could be a thermostat issue.

P0100 - Mass Air Flow Sensor circuit issue - could be the sensor, could be a vacuum leak somewhere...

P0158 and P0159 are both catalyst monitor related faults. Truly a good diagnosis is in order to narrow down if you have a vacuum or air leak. Good luck!