Masturbation can never cause erectile dysfunction (ED).
At this age, ED could most probably be psychogenic (due to familial problems, debts, ...). In this case, you can benefit from Ginseng based drugs.
It will be good, however, to do some blood tests for measurement of cholesterol, sugar and testosterone levels.
As a matter of fact, no studies showed a relation between erectile dysfunction and frequent masturbation. Nevertheless, it is possible to have difficulty to get a normal erection if the sexual intercourse takes place shortly after masturbation, especially in oldet men (after 40).
Most of cases at 25 yo are due to psychological issues. A specialist advice could be useful (a urologist or a sexologist). Medications can be prescribed if needed.