Hello,
please don't Hide your MainForm, but set it's
WindowState to
wsMinimized. Then your TaskBar-Button should still be there and while your Modal-Form isn't closed, the user shouldn't be able to maximize the MainForm by clicking on the Taskbutton.
If your StayOnTop-Window is after minimizing not on the top then you can bring it to front again with
Application.RestoreTopMosts.
Good luck.