High NOx is caused by either insufficient EGR, or ignition timing that is too far advanced. Sometimes the EGR valve will hold vacuum, but will not flow exhaust gas into the intake like it should; because either the valve assembly, a connecting pipe, or a manifold passage is plugged with carbon. If the EGR system works properly, when you pull a vacuum on the valve while the engine is idling; it should cause the engine to stall or the idle to become noticeably rough. If there is little or no change in the idle quality when a vacuum is applied to the valve; then the system is clogged somewhere.
The ignition timing setting is very critical. Sometimes the NOx will go out of spec if the timing is only 3 or 4 degrees off. So the timing must be set exactly to the factory spec. And every once in a while, we come across a car that runs stronger than most other cars of that model; and which fails NOx, when everything is set according to specs. In those situations, the only way to make it pass is to retard the timing beyond the factory spec. The further you retard it, the lower the NOx will go. But you may have to reset the idle speed, if you retard the timing a lot. I would suggest at least 5 degrees retard, and sometimes as much as 10 or 15 degrees. But don't retard it so far that the engine runs rough, after the idle speed is corrected (otherwise, the HC will go out of spec). And too much retard will increase the coolant temperature and may cause overheating in high speed driving.
I hope this helps!!!