How do I add an effect to an entity or player hit by an arrow?

Trying to make some custom weapons for a server, and I just cant wrap my head around how to add effects upon hit... Here's my code currently. ``` execute at @a[nbt={SelectedItem:{id:"minecraft:bow",tag:{CustomModelData:1}}}] run tag @e[type=arrow, distance=3] add slowness_arrow

execute at @e[tag=slowness_arrow,nbt={}] run effect give @e slowness 10 2 true ```

Continue to help post