The gas cap is only the first thing to try for EGR codes. Its a quick fix and inexpensive if that happens to be the cause. My Taco did the same thing and it ended up being the EGR valve. Its a $35 part from Toyota. Its located on the driver side of the intake and you can replace it in about 15 minutes with a 10MM wrench.