Move hpbar-related stuff out of other code
State-machine improvements
Horrible static hack to make bug less severe