How to execute when a mob dies

Trying to make a kind of score system that detects if a player killed a zombie, problem is, I'm trying to make a Vampire Survivors looking datapack so there will be a lot of zombies and other mobs. TL; DR is there a way to detect if one or more mobs die close to a player?
Continue to help post