yea its actually pretty easy to implement. all you need to do is have a variable somewhere that represents the number of enemy lives/spawns, then decrement that number each time a enemy dies, then check the value to see if it equals 0, if it does then run your quit script.
in the below example i created a variable EnemiesCount in the game mode and a custom event to decrease and check its value, then if the value is less than 1 quit the game (picture 1). then in the enemy you just need to get the gamemode, cast to identify the gamemode, then call the function before destroying the enemy actor.simple stuff and this definitely isnt the only way to accomplish this.