I had to dig this up and dust it off from an old ue4 game i made but it should work for you.
I call it stamina with an stamina over time return.
Check it out maybe it’ll help you.
Ps. I was young and did not care about neatness much back then so I rarely cared to use reroute nodes lol I am way better now. Excuse the mess.