Before starting on the modals, I think the errors in the original sentences should be corrected:
1 - I was in the habit of playing tennis when I was a boy. (Not a very natural English sentence.)
2 - OK
3 - She was addicted to nicotine, but she stopped smoking three years ago.
4 - OK
5 - OK, although the present tense sounds a little unnatural here.
Student or Learner