Pretty sure it's an integer not a float, so 4 byte maybe? the problem is the health display is a bar and not a numeral, however when you take damage it shows up in numbers, and I'm pretty sure your max health is displayed in your inventory, so you can decrease by x from y each time you take a hit, something similar may be possible with energy but it constantly recharges.
On the other hand you can just mod invincibility into your save file. https://pastebin.com/Nbgx8K2v
Download this and turn the end filename as a .json instead of a .txt ; then use a save editor and import that item into your save.