Been through this a few times. Not fapping as much helps obviously, but it's never the number one problem. The main problem is always nerves, mental blocks, second guessing, over thinking, insecurities. Put your thoughts 100% on her. How she feels. How she smells. How she moans.
The only times this happened to me were times were I could hear myself think during foreplay. "shyt, my dikk not hard enough yet." "what will she think?" "This bytch average" "I can't fukk this up" etc. When this happens, you go soft because you're incongruent - - your body might be ready to go, but your mind is all over the place.
It's why getting hard with porn is so easy.. there's no worry, as you're focusing solely on the bytch on the screen.
When your mind and body are in alignment you won't be thinking about your dikk, because you strongly believe that it's cooperating with you. When you're in that flow state, you're not worrying if shyt goes wrong.
Up your confidence in your self, learn how to tell yourself to shut the fukk up and enter that flow state when you're fukking a bytch, and ultimately believe that if you bomb in the bedroom, there's a zillion other bytches out here.
Conquer your mind and ED issues will be a think of the past.