how to add absorption but for example half a heart and not 2 like with /effect give

im trying to add 2 hearts of absorption with effect clear effect give. For example when i have 2 hearts and run function i get 4 hearts and it works but when i have 1,5 hearts and run the function i get 2 hearts instead of 3,5 (i knew that is gonna work that way but i dont have any clue how to do it other way)

Continue to help post