What porn does is stimulate and amplify a specific defilement. In so doing it is the exact opposite of what Dharma practice is all about. The enjoyment of it is investing one's innate Buddha Nature into an impurity, and that is what powers the cycle of suffering. We have to choose to create our own suffering, so there has to be some enjoyment in the cycle.
Struggling with it usually doesn't work. In fact by paying attention to the problem you are still feeding the cycle. Focusing your mind on a Dharma image is giving it temporary respite from the battle, a temporary Refuge. In this context "Taking Refuge" means a request for an anchor of sanity in the otherwise insane vicious circle. It doesn't mean that the insanity will vanish, but be more like Ulysses tying himself to the mast as the siren's sang their song. He still felt their lure, but the ropes kept him from acting on it. Refuge is the mast. The ropes are the Vinaya vows. That's why they say Refuge is the basis for all vows.
You can start out with a 24 hour vow. Succeeding will give you confidence and strength. Then perhaps a 48 hour resolution, etc.
A human being has his limits. And thus, in every conceivable way, with every possible means, he tries to make the teaching enter into his own limits. ChNN