Stamina Script working incorrectly

Hello. I'm using Yami's stamina script, where there is a stamina bar when dashing. However, the "auto-hide" function does not seem to work correctly. To start, it is meant to disappear the stamina bar when you aren't dashing, after x frames. However, this only works the first time per game; after that, it always takes around 200 frames to disappear, regardless of number input. This occurs regardless of the presence of other scripts, as I've tested it in a new project. (Also the bar always appears when the game first starts for no reason, which is annoying, but at least it makes it easy to test the auto-hide feature. Fixing this will get you brownie points. <3)

Is there a way to fix this? It's a minor bug for sure, but still an annoying one. Thanks in advance.
On line 351 the @Time is set to 180 frames. This is the pause time before it will disappear.
You can change it to whatever you want or make a new constant if you like.
Code:
    @time = YES::DASH::PAUSE_AFTER_FRAMES
or the built in constant already is
Code:
    YES::DASH::HIDE_AFTER_FRAMES
Looks like that fixed the first issue, thanks! Any chance of stopping the bar from appearing on startup until the player actually runs?
Stopping it from showing up looks to be beyond my knowledge, but you can just set the starting position in the script
Line 276
Code:
    self.x = -200 # $game_player.stamina_backup[:x]
That's good enough! Thank you so much for your help!

Original thread: https://forums.rpgmakerweb.com/threads/stamina-script-working-incorrectly.105081/