Is there any function called when enemy is killed?!

is there any function called when enemy is killed and if so, where is it?!
I wanted to do something like "kill count", I also needed to know the id of the killed enemy.. don't know if it is possible though ;P

Thank for your help!! 😉
You can walk through the troop and check if each enemies health is 0. this would then be called in the update of the scene battle. I would also look at Game Battler and Enemy as they may have specific functions.
Somehing like this should work:

Code:
var _alias_die = Game_Enemy.prototype.die;Game_Enemy.prototype.die = function() {    _alias_die.call(this);    // Increase your kill counter, etc.};
Note, that this function will be called whenever an enemy dies, so it might be called multiple times when revives are involved. If you don't want that, you should use "Game_Enemy.prototype.onBattleEnd" instead and check, if the enemy is dead.
sorry for bringing up such a old post!! But didn't want to create a new one as it is of a related topic!! 

Aliasing the die function is a good option, but what if I need to access killing information?!
for example killing hit was critical hit, killing hit was a spell (what spell), killing hit was normal... how can I access this info, in the enemy killing moment?

Thank you for your time!!

Original thread: https://forums.rpgmakerweb.com/threads/is-there-any-function-called-when-enemy-is-killed.50879/