Which engine?
Turbo or no? if no then waste spark or single spark?
Mechanical timing or electric.
These cars are very advanced electronically for the time, but sensor resolution and ECU tables so limited that typically any one failure represents as vague symptoms that are hard to track down.
Items to check : you are running rich, the first thing i would check is thermostat : they tend to stick open, Go for the 88C (cold weather) thermostat to get a slightly cleaner burn.
While you are there, replace the Cylinder head Temp sensor since its in a similar location on all the engines offered. (the dual wire one, the single wire only works the instrument cluster, not ecu) almost all fuel mapping for this car runs off this sensor, if its not working, your A/F is totally fucked.
Cap and Rotor + wires and plugs. These are cheap and no reason not to replace them. I have had issues with the rotors in the past breaking contact randomly internally.
IF you replace the coils : use OEM nissan coils. They spark hotter and tend to just work well, and are super cheap at yards. If its old enough that it has oil filled coils they might even just give you those for free.
then look at the MAF : if its not functioning as some suggested... you will know it : the car will run rich, bellow black/grey smoke, and be super slow limiting revs to maybe 3.5 to 4 K. Its its *spray fuel and limp home* mode.
then start looking at other things like the Optical Hall sensor in the dizzy if its electronic timing.
Check the TPS sensor, if its out it can prevent the EGR from functioning OR cause it to always remain open.
the O2 Sensor is barely used in the car, and per the FSM after 320km you just unplug the "sensor" light from the dash to keep it from coming on again
The ECU diagnostic mode is just an advanced continuity check. As long as the sensor reports some value, the ECU accepts it as "working". Diagnostic modes 1-2 are A/F trim. 345 are running errors, stored errors, etc.