Coding problems with custom cards.

I'm having some constant problem while coding my own cards for a small set to experiment with (I like programming).
First of all, more than rarely I get the error "...getAbility -- no Cost in [cardname]", prompting the game to crash. Why is this showing up? I ALWAYS have the cost where it should be. If I rewrite the entire line of code, the error disappears, even though the text is IDENTICAL.
Also, take this example. I copy the code from an existing card into my new one. It works perfectly. Then, if I would write the exact same thing into my new card instead, it doesn't work, or e.g the SubAbility doesn't trigger. I'm a pretty descent programmer so I just want to know if this is due to problem with the Forge-application itself and not me.
I'm also having some problem generally with the SubAbility not triggering. What might the causes for that be? (I'm on a Mac).
Thanks for reading and please respond if you've got any input at all!
First of all, more than rarely I get the error "...getAbility -- no Cost in [cardname]", prompting the game to crash. Why is this showing up? I ALWAYS have the cost where it should be. If I rewrite the entire line of code, the error disappears, even though the text is IDENTICAL.
Also, take this example. I copy the code from an existing card into my new one. It works perfectly. Then, if I would write the exact same thing into my new card instead, it doesn't work, or e.g the SubAbility doesn't trigger. I'm a pretty descent programmer so I just want to know if this is due to problem with the Forge-application itself and not me.
I'm also having some problem generally with the SubAbility not triggering. What might the causes for that be? (I'm on a Mac).
Thanks for reading and please respond if you've got any input at all!