Damaging Entites using /damage

Hello, I want to make an item that has a consumable component which shoots a snowball and if that snowball hits an entity i want it to damage the entity execute as @e[type=snowball] at @s run damage @n 15 I tried that but that doesnt work.
Continue to help post