Let's say Gloin has Steward of Gondor attached, giving him the Gondor trait. He also has a Song of Battle attached to give him access to the Tactics sphere.
If he takes a damage, and gains a resource, then plays Gondorian Discipline (GD) to cancel the damage, does he have to give up the resource he gained? My guess would be yes.
Now let's complicate it a bit. Gloin is initially at 0 resources. There is also a copy of Heavy Curse in play, and a copy of GD in the discard pile, making GD cost 1 to play.
Now when Gloin suffers a damage and takes a resource, he uses that resource to play GD. What happens to the damage? What happens to the resource?