Is H4 masters degree eligible for h1b advanced degree exemption (20k cap)?

happy new year!

I’m pursuing masters degree in computer science fin H4 VISA (H1B dependent visa)

In future, if I find an employer who sponsors H1B, can my masters degree be used to apply for H1B under H1B advanced degree exemption (20,000 cap), although i pursue masters in H4 status?

As long as the degree was from accredited US school, you qualify for it.
Your visa status for pursuing masters does not matter. it is the school credentials that matter.