here's how I would do it.
Let's say you use stamina for sprinting. I would Add to a stamina value.. meaning when its full you've taken all the power you can manage, so you need to rest. So maybe "exhaustion" would be a better variable name now that I think of it!
So this gives you 4 seconds of sprint, if you release before you go over the 4, the stamina cools down as fast as it went on. But if you go over 4 seconds, you overheat and can't use sprint for a the whole 4 seconds and the stamina comes off in 4 seconds.
you can play with the numbers and make it more punishing to overheat or make the dissipation faster than it goes on. In that case just do Subtract dt*2 or something, so you would keep the 4 seconds of sprint (adding 1 stamina per sec), but if you let go early, the dissipation is only 2 per second.