well this is because you're using floor when calculating life/lifemax, so basically any value lower than 1 will always become 0 so your math will also become 0
your code for value basically says "1280 * round down(1000/1000)" when at lifemax, but if that life valñue goes down by even 1, 999/1000 = 0.999, rounded down would be 0.
What you want to do is change it so the floor (or ceil) is applied after the miltiplication, so, tl;dr:
value = 1280 * floor(life / lifemax)
value = floor(1280 *(life / lifemax))
hope that helps