if you have flash effect i have made a rather simple off on switch for invincibility
put all the monsters in a group
or put your collisions with the monsters in a group.
when your character is flashing turn off the group that causes you to take damage.
If character is flashing -->> Turn off group Monster is hitting me
and
Character on Flash end -->> Turn on group Monster is hitting me
basically as long as your flashing you cannot take damage or get hit!
give it a try