They seem to me all non-essential clauses with "which":
1) can be read as:
, which she had been taking medicine for during that time.
if this order is more clear to you.
4) may be read as:
, which is leading/which leads to the ...
For references, try:
Extended Rules for Using Commas
Darling's Guide to Grammar and Writing