If you're in the US, look into FMLA, or possibly even consult an employment attorney to put together a plan.
If you are going to be in and out, not 100%, etc... you are better off erring on the side of taking medical leave, asking for accommodations as needed, rather than trying to "soldier on" and have any unavailability used against you or characterized as a performance issue.
Aside from that, treat your new boss as a new job / new company that you need to prove yourself too. Your new boss didn't choose you, and may have a desire to "make changes", bring his own people in... etc.