Honda Civic HX Annoying Check Engine Light

Hey, I have a 2000 Honda civic HX and had the check engine light come on and took it to a local Auto Zone to see why it came on, it was running fine as far as I could tell. They said it had multiple misses on cylinders and low ERG flow. They recommended that new plugs, distributor cap, rotor, and wires. I bought and put them on, cleared the code and it came back on. I went back to Auto Zone and the same codes showed up, they suggested that I take it to a Honda dealer for further diagnostics. The fine folks at the Honda dealer told me that they couldn’t run a diagnostic on it because I had put non-Honda parts on it and recommended that I have them replace them a the tune of $256. I bought the Honda parts and put them on myself, same problem. I discovered how to read the codes from the computer module on line and come to find out they were the same as Auto Zone had told me. Now the car was running bad at a little above an idle ~1500 RPM Pressing on the accelerator made it go away or backing clear off it would also make it run smooth. So I purchased a new EGR valve (Honda certified part) and it had the same problem, but I found out that when I unplugged the wiring connection from the EGR valve the car would run fine, but lost a couple MPG. I then purchased a throttle position sensor, no dice same problem. So I’ve been driving it for the last couple of months with the EGR unplugged. Can someone advise, I hate to take it back to the Honda dealer because I feel they were leading me astray. Thanks