How can i run the function based on who shot it and if they had a an item with a specific tag

execute at @e[type=minecraft:arrow,nbt={inGround:1b,CustomPotionEffects:[{Id:20,Duration:10,ShowParticles:1b}]}] run summon minecraft:tnt ~ ~ ~ {Fuse:0}

execute as @a[nbt={SelectedItem:{tag:{raz:true}}}] run function

kill @e[type=minecraft:arrow,nbt={inGround:1b,CustomPotionEffects:[{Id:20,Duration:10,ShowParticles:1b}]}]

Continue to help post