for non jump actions your first rule is checking the difference between Y positions. if it is for example < 2 pixels you continue with the rest.
then you check action state (type of action, frame count...) and based on that you check for 'hitpoints' based on the X positions ranges.
for jumping actions you combine the X position ranges with Y position ranges as some hits only may occur at the last frames of the upgoing jump movement.
the 'easiest' would be to create an editor for this in B4J as it would require less testing than doing it all manual if your animations have a lot of frames.
I don't know if Box2D would be a real help here as it would probably require to create all hit points for current player states realtime or pre-create and enable/disable and you'll need to check Y positions anyway as collision rectangles may overlap when no hit is possible as you walk in 4 directions.
Maybe it has some 2D specific method for this, I dunno.