Can I file H1B petition while I am on CPT?

I had completed my Masters in Mechanical Engineering in Dec 2015, and used my OPT for 11 months. Again I had joined second Masters in Manufacturing Engineering in Jan 2017. Now I am in my 3rd semester and left with only thesis work which I will be completing by summer 2018. Currently working on CPT from Jan 2018 as an Engineering Intern. The company is willing to offer me a Full time position and sponsor for H1B. As I have used up all of my OPT I will not be eligible to apply again after my graduation. Can I file H1B petition in April 2018 using my previous Masters? Will I be considered for the Masters Cap? If I extend my thesis defense till September 2018 and get a letter from registrar stating that I have completed all my degree requirements so that I can start working from Oct 2nd 2018. Is it possible?

Yes, you can apply for H1B under Master’s quote if your Master’s degree (any of completed degrees) is from Non-Profit and is qualified under Master’s quota