I am using this code snippet

Its working fine if you have over 10K of HP however if you are below that
It also decreases the MAX HP.
here is an picture to let you see
If i remove the code snippet and do it the normal way its working like it should be working.
Could someone explain why this is happening?
With kind regards.






