[RPG MV]Custom State(?)

Hello
I use yanfly plugins.
I need the MP Cost to be halved just for
abilities of a specific element type.
Are there any codes for this?
I tried to use this code in the state, but it reduces the cost of All Skills and disappears after I use Element 11 Skills.
Code:
<Custom Initiate Effect>
var eId = 11;
// element to check for
if (this.getItemElements().contains(eId)) {
// Then remove the state.
user.removeState(stateId);
}
</Custom Initiate Effect>

Original thread: https://forums.rpgmakerweb.com/threads/rpg-mv-custom-state.111538/