Substance addiction e.g. heroin is treated by gradually decreasing doses of a less potent substance other than heroin (if I am correct).

Is this rule can be applied to any other addiction e.g pornography or it is only for substance addiction ?