help with lambda function

I have 2 lambda functions

 bool EventTargetDied() =>
        target != null && target.health.current == 0;

bool EventDied() =>
        health.current == 0;

and I want to add an increment to count each time they die and I die. also need to check if the target is a player or a monster. this is all through ummorpg so the variables already exist. something like this would suffice, but I don’t know if it’s the proper syntax.

 EventTargetDied(){
    if (victim is Player){
    if (target != null && target.health.current == 0;){
    playerkills += 1;
    }
 if (victim is Monster){
    if (target != null && target.health.current == 0;){
   monsterkills += 1;
}
}

EventDied()
{health.current == 0;}

something tells me this is an inaccurate approach tho.

I could also use this method. might be an easier approach.

[Server]
    public virtual void OnDeath()
    {
        // clear target
        target = null;
        
    }