I'd 1st check the connections to the EGR valve, if either the vacuum pipe of electrical connection are damaged / corroded then the EGR can be on all time which certainly will hurt performance. Its also possible that its a fault with the EGR valve so its worth removing the valve and cleaning it out with brake cleaner, if it looks particularly clogged then replace it.
This could also be a wiring issue as things tend to expand when hot and its possible a poor or partial electrical connection is being pushed apart on one of the major sensors so check the connection plug and wiring to the following;
Crank position sensor
Cam position sensor
Throttle pedal position sensor
Also worth checking the connections to the fuel pump for the same reason - unplug each in turn and give them a good squirt of switch / contact cleaner - Not WD40
and also unplug and inspect the main power relays and fuses for signs of overheating or corroded terminals - so the ones for the ECU and the fuel pump
And also unplug the wiring loom connections in the engine bay one at time and inspect for corroded or recessed pins.