Tl;dr You should probably get advice from an immigration lawyer before trying this. Also you should probably check with your company's lawyer that filed your H-1B.
This Nolo.com article from @qoba's comment explains why it could become an issue if you take extended leave from an H-1B position while remaining in the US:
"If you will be remaining in the United States, it could be a bit more challenging. There is no clear guidance on whether you could maintain lawful H-1B status during a prolonged absence from work, even if your employer approved it. As mentioned above, the H-1B visa is a work visa and is not meant for sabbaticals. The challenge could arise when your employer files the next H-1B petition. USCIS could determine that you did not maintain H-1B status and therefore deny the request to extend your status. It then most likely would be an uphill battle to get back into lawful H-1B status."
One possible alternative might be to apply for change of status to F-1 when you begin the leave, and have your company apply to change your status back to H-1B in time for you to resume work. However, this may cause problems if the change of status takes too long. You could study full time while a change of status from H-1B to F-1 is in process, but if it's not approved before you finish studying you might have difficulty changing back to H-1B status as planned.