How to recognize change while holding down and input?

I have created a function for sprinting that is activated when I press an input from a keyboard or controller. This sprint is tied to a stamina system that regenerates when not sprinting. I have functions for stamina regeneration and stamina depletion as well. The sprint button is pressed and held down to continue to sprint. When I stand still while the button is pressed the stamina does not regenerate. I need to release in order for the stamina to regenerate. I would consider myself a blueprint beginner and still have a lot to learn. I had followed a tutorial series and done much research on this but can’t seem to find anything related to solving this issue. Any information that could point me on the right direction would be helpful.

These are the tutorials I had followed in case anyone is curious.

https://www.youtube.com/watch?v=o10UUTeKYKw&t=380s

Here are images of my blueprints to see how it’s set up

Here is my stamina regeneration function