Suppose the conduct is legal under state law, like marijuana use in some states?
The fact that your state has decriminalized marijuana use is not relevant. Drug use is a crime under UCMJ Article 112a, 10 U.S.C. 912a. There is no "off time" for drug use purposes. The good news is that many positive urinalysis cases are resolved by an administrative discharge rather than by referral to a court-martial.