Changing status when studying on H1B

I am planning to do MS in distance mode while i am working on H1B. For some universities; there is a rule of one-semester on-campus habitation even in distance mode. Can I start my MS on H1b and later switch to F1 for 6 months as my employer may not agree to keep me on payroll for 6 months when I am not working? After 6 months; can i use my current h1b as a COS or do i have to wait for the next year cap? Meaning will i be cap-exempt if i have to file a new H1B? Can i continue to work with the same employer with my current H1B?