H1B 6 year cap rule and duration outside US

I was once denied a petition extension and had to return to India where I stayed for more than 400 days before reapplying in cap-exempt category and landing in USA again. Now, I am in the last year of H1B before it maxes out at the 6 year limit. My question is that, when I was outside for more than a year, did that reset the 6 year clock? Can I reapply for new H1 or L1 while in US or do I have to return to India again and wait for a year for cool off?

No, it will not reset the clock, unless you have gone through cap again or you have got the I-140 approved. You would need to either have Green Card process started or go through lottery again for being cap exempt. You may read below

Well what I am asking is that, will I have to wait for a year in order to run my petition again? I understand I will have to go through the lottery, yes.