I hope you bought this car cheap with all the parts you put into it? With over 200K miles there could be many things that cause this behavior, like corrosion in wires, connectors etc. Example: my 1992 300zx NA had to have the injectors replaced to the pintleless design post 93, they failed with E fuel and corrosion. When I got in there to install new required connectors for the different injectors I found corroded green copper wires to the connectors, a contributor to failure IMO. I had to cut back to fresh wire for good connection.
Not sure this will fix yiur issues but it might help get cleaner signals to the electric parts, I did this to my Z and my I30 as PM. Start pulling all the connectors you can get at ONE AT A TIME. Clean them and put a nice gob of dielectric grease in the female part and reconnect. Mark the connector with a sharpie pen so you know it is serviced. Especially the injector connectors and coolant temp sensor they get corrosion. Also any grounds and the battery terminals - pull them clean the batt posts and the female part of the + and - cables, put dielectric grease on the post and cables and reinstall - this prevent electric arcing corrosion.
Since you have a warmed up engine issue have you checked the coolant temp sensor ohms? Have you checked the thermostat for correct temp control? A thermostat modulates during operation based on load to maintain a temp range and if the coolant isn't within that range the ECU will send different voltage signal to injectors and other components which could result in your problems? The easiest way to check thermo is to shoot it with an infra red temp gun when fully warmed up. The coolant temp spec is in the Service Manual. If you replace the thermo do a stove top test (see Manual) and heat the water and note temp when valve just opens and full open temp and compare to specs. New has been known to be out of calibration. I would only use OEM on this part.
As suggested properly adjust the TPS.
Service Manual 1998 Maxima:
http://www.nicoclub.com/FSM/Maxima/1998/
Good luck