The EGR code is probably because of restriced EGR passages. The EGR system needs to be disassembled and cleaned out (including the EGR valve). EGR passages clogs and restrictions are very common in trackicks.
The TPS may just need to be adjusted correctly. If that doesn't fix the issue and/or if the TPS specs don't check out, then the TPS is likely bad and needs replaced.
I noticed you said you replaced the TPS.....was the replacement a known good one?.....was it adjusted correctly? There are some pretty precise adjustments that have to be made to the TPS, for it to work correctly.