You probably get a grace period after you leave your jobs that might be close to the 3 months required for YC. At least as a start.
It might be possible to apply a new H1B based on your YC company, or obtain other work authorization like EAD to be able to work in the US.