give effect on trident impact

how can i make an effect applying on a player that was hit by me with trident? i stopped at this section in tick function: execute as @e[type=trident,nbt={DealtDamage:1b}] at @s if i have to do it with advancement then how?
Continue to help post