Conditional for spesific monster atacking to Character

For example If a giant party or champion party monster is atacking me use “Skillname”. Else cancel buff.

I want to use it for Ice Wall skill.
Because in buff setting if I do that the character casts the skill even the GP not atacking to character and it makes problem when the GP is far away.