One way of doing that could be, when you start sprint then SetMaxWalkSpeed and call your DecreaseStamina function with a timer that loops per some time and check if velocity is not 0 then decrease stamina. And when stop Shifting just clear or stop the timer. This way you have to reduce the stamina by small ammount in your DecreaseStamina function.
I’m not sure how timers look like in c++ though, but maybe you find this way helpful.
Another way could be, when your Event that starts the run movement fires, check if isSprinting (maybe based on current Max Walk Speed) and fire DecreaseStamina function again.