Yes, habit-forming, but so is everything else. We are a people of habit. It is not necessarily a bad thing. If the substance works, we keep taking it. If we like something, we keep doing it, but even if we do not like something, we usually keep doing it, because we just cannot help it, for the most part. We really are creatures of habit. People go to work and back home using the same route, they may take coffee every morning, and so forth. I observed people before on a daily basis when I was learning behavior modification. It is really easy to predict people's behavior because of how much of a habitual creatures we are. You could be conscious about your own behavior and you will find that you are doing a lot of things out of habit, too.
So to reiterate: amphetamines may be habit-forming, but you have to ask why. The reason is simple: because it has positive effects and you like them and want to keep having them. Of course if the negatives outweigh the positives (up to the individual to decide), then it can become problematic if you cannot stop. Some people simply cannot stop on their own and will need help. I was on 4 different psychiatric medications and I stopped. It was a hellish phase of my life, but I succeeded. I did it all alone.
My friend takes opioids because it works as an antidepressant and anxiolytic for him. It makes him productive that he likes. He goes through withdrawals voluntarily once per a few months or something, so he will not have to increase the dose. We are different, I suppose. For the record: he has been doing it for years, and he gets regular blood and urine tests done, along with ECG, MRI, and so forth. It does not affect his health negatively.
Back to amphetamines: yes, amphetamines do affect the immune system. My other friend uses it for ADHD, and it lowered his immune system. He does not experience many negative side-effects and has been taking it for years now. He does experience some minor side-effects, and for him it is worth it, which is understandable as it essentially saved his life. Plus, he is particularly sensitive to it though, if he takes 10 mg more, he can definitely feel it, whereas I can take 10x more and would not feel a thing (without tolerance). This is a different story, but stimulants do not work the same way for me as they do for most people. It may be because of the autoimmune disease I have, or something else, I do not know.
When I was on amphetamines for 2 weeks, after that time I experienced PVCs (premature ventricular contractions), but that is because my heart is not 100%. I am sitting most of the time and it affects my health a lot more than amphetamines would, but they exacerbate the issues. I experimented a bit with it, and after walking every day an hour, the PVCs disappeared. Exercise really does make a difference, even just something as simple as walking does make a difference. I need to get into the habit (pun intended) of walking, because both my feet get swollen from sitting too much and it could mean a lot of things, bad things. It could be my heart for all I know. I will have it checked out as soon as possible, but this prolonged sitting is definitely not good and might be the end of me. :/ I also have a one-sided diet, so I gotta fix that, too.
If you want to keep taking it, you have to have a healthy diet, you have to exercise (and sit less), and take therapeutic doses only. Do not go above that. If you feel that it does not work anymore, you may have to find some time where you can decrease your tolerance: you can go cold turkey (stop abruptly), or you can gradually decrease the dose. If you take the abrupt cessation route, it will be gone from your system within about 2 weeks, and you can start over with the therapeutic doses, no need to increase the dose. Amphetamine withdrawal does not kill you, it is just unpleasant. You can make it less unpleasant by gradually getting off of it, but then it will take more than 2 weeks. It is entirely up to you. Some people can manage to gradually get off of it and still go to work, but it will be uncomfortable. To sum it up: healthy diet, exercise (and less sitting if possible), and therapeutic doses. If you still experience the side-effects, you could lower the dose and you might still have the positives. If all of this does not work, then you might really have to give it up, but it is worth a shot if you liked the positives. There are, of course, nutritional supplements that may help. Propolis & royal jelly & honey are great for the immune system, among other things[1].
By the way, did you take therapeutic doses? What were your side-effects?
---
I apologize for the length of this comment, I made it longer than I initially wanted.
[1] https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5549483/