I can compile it but it doesn't work for me.
Why does it not work for you?
use "t" to decrease the willenskraft variable and you will see that the bar will become shorter. I set it on "t" just that you can see that the bar is working (also with decimals).
Of course for a real healthbar you need a damage system and code that defines when the variable should be decreased

cheerio