2001 Madza Tribute With Stalling Problem *Help*

Hello All, this is my first post so let me know if I need to provide additional info. I have a Manual 2001 Mazda Tribute with 197K Miles this vehicle has been a real gem but it has had one problem that started a year or so ago and has started to occur more often every now and then it will either not start up after it has been running or it will cut off when I come to a stop while driving and will not start back under normal conditions. Normal conditions being just turning the key over and starting but if I keep my foot on the gas pedal it will start and run until I take my foot off the gas and it will cut off. After10-20 minutes it will start up just fine and run for days or weeks then it will start again. I have had the Idle Control Sensor changed and the fuel filter but the problem still continues I had the check engine light scan but I have been told that it does give off a fuel code but nothing conclusive. I was wondering if it was the fuel pump but I would think that it would not continue to run while I had my foot on the gas pedal if the pump was bad but I could be wrong. I appreciate any insight as I am at my wits end…
Thanks