Fixing arrow damage tick delay

Hello, I want to make a, datapack that fixes the damage tick delay for arrows. So for example, if I shoot any entity with a multishot crossbow and all 3 arrows should be the entity, only one does and 2 bounce back. Now I know damage delay is hardcoded in the game, so my approach would be, to execute for any arrow that is going to hit an entity that is already hurt, add the damage the arrow would inflict on the entity to a variable, and delete the arrow(s) and then, once the entity isn't hurt any more it gets the damage from our variable (preferably also storing the owner of the arrow so that if our added damage kills the Target, the owner gets the credit for the kill). I have very little knowledge about data because I'm used to commanding blocks, so my question is, how would you guys approach this problem? Maybe what are your first steps and if you could maybe help or show me?
Continue to help post