Need help writing a mechanic that will accumulate a sum of lost stamina

I mean, for example lets say you call DrainOrRegenStamina in your tick event, you’d want to use “get stamina” node there and pass it to the DrainOrRegenStamina event like this picture :

Inside the DrainOrRegenStamina itself you’d want something like this :

I obviously don’t have the logic for the set stamina nodes in the picture. Just put your own logic there.