Incompleted and interrupted spells do count as one of the two castings, but failed skills do not.
If an attunement is active, you will still get the whole percentage of energy back, even if the spell cost you nothing.
Since it reduces the cost by 10 even without any points spent into Energy Storage, it can easily be used by secondary Elementalists as an Energy management skill.