Have a boolean attribute controlling your collision.
when collision happens
if boolean = false
set boolean to true
do whatever heart subtraction thing.
kill the bullet
If the collision happens inside of the bullet, then you are set. If you have the collision happen within the player or scene, then add
do after 1 second
set boolean to false
This will give you 1 second of invincibility after getting hit. You can change the 1 second to whatever you want.