&& abs(x+16-obj_hero.x) < 72
You don't need this. The scr_HeroIsNearTrap should be checking where the hero is, so you don't need to check it here. That's the point of having the script - it does all of the position checking for you.
I think the most sensible solution I have outlined in this picture would be that the champion takes damage while in the middle of a trap and takes damage from frame 15 (image_index)
Okay, that's not what you put in the picture. In the picture, you said "When the trap starts to play its animation, then it should take the energy of the hero". You need to describe what you want accurately. That goes extra for the computer, because a computer will never try to guess what you mean. It will just do exactly what you say, and if you said the wrong thing, it will do that.
you mentioned that I have to check if image_index is greater than zero right?
I don't believe I ever said that, and if I did, you've changed your mind at least once since about what you say you want. What you need to check is what you want to check. By now, you should have all the tools you need. You shouldn't need to come back and ask how to compare values.
if image_index > 14 && image_index < 16 { if obj_hero.hurtClock = 0 { obj_hero.hp -= 1; obj_hero.hurtClock = room_speed*2 } }
First, what is hurtClock? Is it some kind of invulnerability timer? I don't think you need that for just this. Get rid of it for now, and once you understand what you're doing here, you may be able to put it back if it does something you need. Second, why aren't you checking scr_HeroIsInTrap here? That's the whole point of having a function to check something. You say "I only want the hero to be hurt if the hero is in the trap." So... only hurt the hero if the hero is in the trap. This is where you hurt the hero, so check whether the hero is in the trap and only hurt the hero if the hero is in the trap, because that's what you said you wanted. Which part of the code you pasted was supposed to check whether the hero is in the trap? Remember, nothing that you post on a forum has any effect on your game. You need to put the things you want to be in your game in your game. This is what I meant when I said you need to think about what you're doing. If you can't describe it to me, in natural language (however auto-translated it may be), then how do you expect to describe it to a computer, which needs every detail to be exact?