here is some working code:
var hearts = 4:
get:
return hearts
set(new_value):
set_hearts(new_value)
of course, with this new syntax you don't even need to call the setter anymore (if you don't need it as a separate function) but instead can also directly write the code in the setter:
var hearts = 4:
get:
return hearts
set(new_value):
hearts = new_value
// do whatever you want here