Row 1
1. [repeat] /execute as @a at @s if entity @e[type=minecraft:happy_ghast,distance=..4] if entity @e[type=snowball,distance=2..4] run summon fireball ^ ^ ^1
2. [chain] /execute as @a at @s if entity @e[type=minecraft:happy_ghast,distance=..4] if entity @e[type=fireball,distance=..8] if entity @e[type=snowball,distance=2..4] run data modify entity @e[type=fireball,distance=..8,limit=1] Motion set from entity @e[type=snowball,distance=2..4,limit=1] Motion
3. [chain] /execute as @a at @s if entity @e[type=minecraft:happy_ghast,distance=..4] if entity @e[type=snowball,distance=2..4] run playsound minecraft:entity.ghast.warn ambient @a ~ ~ ~
4. [chain] /execute as @a at @s if entity @e[type=minecraft:happy_ghast,distance=..4] if entity @e[type=snowball,distance=2..4] run playsound minecraft:entity.ghast.shoot ambient @a ~ ~ ~
5. [chain] /execute as @a at @s if entity @e[type=minecraft:happy_ghast,distance=..4] if entity @e[type=snowball,distance=2..4] run kill @e[type=snowball,distance=2..4,limit=1]