The manual reads like it gets called for every entity, I guess you could tag yours with a specific skill to figure out when you want to run a certain action.
To chain them, just take the pointer of the previous function and run it inside of yours, something like this:
function (*prev_ent_remove)(ENTITY *);
function my_ent_remove(ENTITY *ent)
{
// ...
if(prev_ent_remove)
prev_ent_remove();
}
void main()
{
prev_ent_remove = ent_remove;
ent_remove = my_ent_remove;
}
(No guarantee that this will run like this in Lite-C cuz Lite-C is weird af, but you get the idea)