Program: 187535
Project: 187535
Buggy source:
@EventHandler(priority=EventPriority.MONITOR) public void onEntityDamageByEntityResult(final EntityDamageByEntityEvent event){
  if (event.getEntity() instanceof CraftMyPet && ((CraftMyPet)event.getEntity()).getPetType() == MyPetType.Enderman) {
    ((EntityMyEnderman)((CraftMyPet)event.getEntity()).getHandle()).setScreaming(true);
    ((EntityMyEnderman)((CraftMyPet)event.getEntity()).getHandle()).setScreaming(false);
  }
  if (event.getEntity() instanceof LivingEntity) {
    if (event.getDamager() instanceof Player) {
      Player damager=(Player)event.getDamager();
      if (damager.getItemInHand().getType() == MyPetConfiguration.LEASH_ITEM && event.getEntity() instanceof CraftMyPet) {
        return;
      }
      if (MyPetList.hasMyPet(damager)) {
        MyPet myPet=MyPetList.getMyPet(damager);
        if (myPet.getStatus() == PetState.Here && event.getEntity() != myPet.getCraftPet()) {
          myPet.getCraftPet().getHandle().goalTarget=((CraftLivingEntity)event.getEntity()).getHandle();
        }
      }
    }
 else     if (event.getDamager() instanceof CraftMyPet) {
      MyPet myPet=((CraftMyPet)event.getDamager()).getMyPet();
      event.setDamage(myPet.getDamage());
      boolean skillUsed=false;
      if (myPet.getSkills().hasSkill("String_Node_Str")) {
        Poison poisonSkill=(Poison)myPet.getSkills().getSkill("String_Node_Str");
        if (poisonSkill.activate()) {
          PotionEffect effect=new PotionEffect(PotionEffectType.POISON,poisonSkill.getDuration() * 20,1);
          ((LivingEntity)event.getEntity()).addPotionEffect(effect);
          skillUsed=true;
        }
      }
      if (!skillUsed && myPet.getSkills().hasSkill("String_Node_Str")) {
        Wither witherSkill=(Wither)myPet.getSkills().getSkill("String_Node_Str");
        if (witherSkill.activate()) {
          PotionEffect effect=new PotionEffect(PotionEffectType.WITHER,witherSkill.getDuration() * 20,1);
          ((LivingEntity)event.getEntity()).addPotionEffect(effect);
          skillUsed=true;
        }
      }
      if (!skillUsed && myPet.getSkills().hasSkill("String_Node_Str")) {
        Fire fireSkill=(Fire)myPet.getSkills().getSkill("String_Node_Str");
        if (fireSkill.activate()) {
          event.getEntity().setFireTicks(fireSkill.getDuration() * 20);
          skillUsed=true;
        }
      }
      if (!skillUsed && myPet.getSkills().hasSkill("String_Node_Str")) {
        Slow slowSkill=(Slow)myPet.getSkills().getSkill("String_Node_Str");
        if (slowSkill.activate()) {
          PotionEffect effect=new PotionEffect(PotionEffectType.SLOW,slowSkill.getDuration() * 20,1);
          ((LivingEntity)event.getEntity()).addPotionEffect(effect);
          skillUsed=true;
        }
      }
      if (!skillUsed && myPet.getSkills().hasSkill("String_Node_Str")) {
        Knockback knockbackSkill=(Knockback)myPet.getSkills().getSkill("String_Node_Str");
        if (knockbackSkill.activate()) {
          ((CraftEntity)event.getEntity()).getHandle().g(-MathHelper.sin(myPet.getLocation().getYaw() * 3.141593F / 180.0F) * 2 * 0.5F,0.1D,MathHelper.cos(myPet.getLocation().getYaw() * 3.141593F / 180.0F) * 2 * 0.5F);
          skillUsed=true;
        }
      }
      if (!skillUsed && myPet.getSkills().hasSkill("String_Node_Str")) {
        Lightning lightningSkill=(Lightning)myPet.getSkills().getSkill("String_Node_Str");
        if (lightningSkill.activate()) {
          Lightning.isStriking=true;
          LightningStrike bolt=event.getEntity().getLocation().getWorld().strikeLightning(event.getEntity().getLocation());
          Lightning.lightningList.put(bolt,myPet);
          Lightning.isStriking=false;
        }
      }
    }
  }
}

Fixed version (ground truth):
@EventHandler(priority=EventPriority.MONITOR) public void onEntityDamageByEntityResult(final EntityDamageByEntityEvent event){
  Entity damagedEntity=event.getEntity();
  if (damagedEntity instanceof CraftMyPet && ((CraftMyPet)damagedEntity).getPetType() == MyPetType.Enderman) {
    ((EntityMyEnderman)((CraftMyPet)damagedEntity).getHandle()).setScreaming(true);
    ((EntityMyEnderman)((CraftMyPet)damagedEntity).getHandle()).setScreaming(false);
  }
  if (damagedEntity instanceof LivingEntity) {
    if (event.getDamager() instanceof Player) {
      Player damager=(Player)event.getDamager();
      if (damager.getItemInHand().getType() == MyPetConfiguration.LEASH_ITEM && damagedEntity instanceof CraftMyPet) {
        return;
      }
      if (MyPetList.hasMyPet(damager)) {
        MyPet myPet=MyPetList.getMyPet(damager);
        if (myPet.getStatus() == PetState.Here && damagedEntity != myPet.getCraftPet()) {
          myPet.getCraftPet().getHandle().goalTarget=((CraftLivingEntity)damagedEntity).getHandle();
        }
      }
    }
 else     if (event.getDamager() instanceof CraftMyPet) {
      MyPet myPet=((CraftMyPet)event.getDamager()).getMyPet();
      event.setDamage(myPet.getDamage());
      boolean skillUsed=false;
      if (myPet.getSkills().hasSkill("String_Node_Str")) {
        Poison poisonSkill=(Poison)myPet.getSkills().getSkill("String_Node_Str");
        if (poisonSkill.activate()) {
          PotionEffect effect=new PotionEffect(PotionEffectType.POISON,poisonSkill.getDuration() * 20,1);
          ((LivingEntity)damagedEntity).addPotionEffect(effect);
          skillUsed=true;
        }
      }
      if (!skillUsed && myPet.getSkills().hasSkill("String_Node_Str")) {
        Wither witherSkill=(Wither)myPet.getSkills().getSkill("String_Node_Str");
        if (witherSkill.activate()) {
          PotionEffect effect=new PotionEffect(PotionEffectType.WITHER,witherSkill.getDuration() * 20,1);
          ((LivingEntity)damagedEntity).addPotionEffect(effect);
          skillUsed=true;
        }
      }
      if (!skillUsed && myPet.getSkills().hasSkill("String_Node_Str")) {
        Fire fireSkill=(Fire)myPet.getSkills().getSkill("String_Node_Str");
        if (fireSkill.activate()) {
          damagedEntity.setFireTicks(fireSkill.getDuration() * 20);
          skillUsed=true;
        }
      }
      if (!skillUsed && myPet.getSkills().hasSkill("String_Node_Str")) {
        Slow slowSkill=(Slow)myPet.getSkills().getSkill("String_Node_Str");
        if (slowSkill.activate()) {
          PotionEffect effect=new PotionEffect(PotionEffectType.SLOW,slowSkill.getDuration() * 20,1);
          ((LivingEntity)damagedEntity).addPotionEffect(effect);
          skillUsed=true;
        }
      }
      if (!skillUsed && myPet.getSkills().hasSkill("String_Node_Str")) {
        Knockback knockbackSkill=(Knockback)myPet.getSkills().getSkill("String_Node_Str");
        if (knockbackSkill.activate()) {
          ((CraftEntity)damagedEntity).getHandle().g(-MathHelper.sin(myPet.getLocation().getYaw() * 3.141593F / 180.0F) * 2 * 0.5F,0.1D,MathHelper.cos(myPet.getLocation().getYaw() * 3.141593F / 180.0F) * 2 * 0.5F);
          skillUsed=true;
        }
      }
      if (!skillUsed && myPet.getSkills().hasSkill("String_Node_Str")) {
        Lightning lightningSkill=(Lightning)myPet.getSkills().getSkill("String_Node_Str");
        if (lightningSkill.activate()) {
          Lightning.isStriking=true;
          LightningStrike bolt=damagedEntity.getLocation().getWorld().strikeLightning(damagedEntity.getLocation());
          Lightning.lightningList.put(bolt,myPet);
          Lightning.isStriking=false;
        }
      }
    }
  }
}