more damage

ok so basically, I'm making a datapack with some custom swords, im making it if you have one of them in your inventory and are below 6 hearts, you take 50% less damage, i also have another but its 30% more damage, anyway, ive got the detecting if you have it in your inventory and the 6 hearts, just how do i make them take less/more damage? thanks, im on 1.21
Continue to help post