The only way to stop this habit is self control. You have to keep yourself busy. And try not to watch porn.
To cure the damages from it you should start taking Shilajit. You can buy the capsules of Shilajit or it comes in liquid form, both are really effective and you'll see effect in two or three days. Your long lost stamina will start to return.