Collisions

You can adapt your js function to work on the processCallback:
https://photonstorm.github.io/phaser3-docs/Phaser.Physics.Arcade.Collider.html

If your function detect a pixel perfect collision return true else return false, If true the collideCallback is called and you can handle the collision.

For detecting if the captain america has hit an enemy you can check for the current animation frame:

captainAmerica.anims.currentFrame.textureFrame