Having trouble with prototypes and P2 setPostBroadphaseCallback

I’m using prototypes for making lots of the same enemy, with unique “this.” variables. This seems to be causing a problem with the P2 physics setPostBroadphaseCallback I have in place for the sprites. When the function “hitboxCheckDroidBaton” is called in setPostBroadphaseCallback, it only takes the variables from the newest enemy created. If anyone knows why this may be happening I would really appreciate the help.

this.droidFnc.prototype.hitboxCheckDroidBaton = function(body1, body2, attackDummy, droidInvincibilityDummy, droidHealthDummy) {

if (((((body1.sprite.key === ‘baton’ && body2.sprite.key === ‘playerHB’) || (body2.sprite.key === ‘baton’ && body1.sprite.key === ‘playerHB’)) && this.attack == 3 && this.attackTimer < 30) || ((body1.sprite.key === ‘droid’ && body2.sprite.key === ‘playerHB’) || (body2.sprite.key === ‘droid’ && body1.sprite.key === ‘playerHB’))) && playerInvincibility == 0) {
playerHealth -= 1;
playerInvincibility = 60;
}

if (((body1.sprite.key === ‘wrench’ && body2.sprite.key === ‘droid’) || (body2.sprite.key === ‘wrench’ && body1.sprite.key === ‘droid’)) && swing == 1 && this.droidInvincibility == 0) {
this.droidHealth -= 1;
this.droidInvincibility = 75;
if (player.x < this.droid.x) {
this.droid.body.velocity.x += 500;
this.droid.body.velocity.y += -90;
} else {
this.droid.body.velocity.x += -500;
this.droid.body.velocity.y += -90;

 }

}
return false;

}

nvm fixed it.