(1) If a person is charged under sub. (2m) with a felony offense under this chapter that is a 2nd or subsequent offense as provided under sub. (3) and the person is convicted of that 2nd or subsequent offense, the maximum term of imprisonment for the offense may be increased as follows: (a) By not more than 6 years, if the offense is a Class C or D felony.(b) By not more than 4 years, if the offense is a Class E, F, G, H, or I felony.(2m)(a) Whenever a person charged with a felony offense under this chapter may be subject to a conviction for a 2nd or subsequent offense, he or she is not subject to an enhanced penalty under sub. (1) unless any applicable prior convictions are alleged in the complaint, indictment or information or in an amended complaint, indictment or information that is filed under par. (b) 1. A person is not subject to an enhanced penalty under sub. (1) for an offense if an allegation of applicable prior convictions is withdrawn by an amended complaint filed under par. (b) 2.(b) Notwithstanding s. 971.29(1), at any time before entry of a guilty or no contest plea or the commencement of a trial, a district attorney may file without leave of the court an amended complaint, information or indictment that does any of the following: 1. Charges an offense as a 2nd or subsequent offense under this chapter by alleging any applicable prior convictions.2. Withdraws the charging of an offense as a 2nd or subsequent offense under this chapter by withdrawing an allegation of applicable prior convictions.(3) For purposes of this section, a felony offense under this chapter is considered a 2nd or subsequent offense if, prior to the offender's conviction of the offense, the offender has at any time been convicted of any felony or misdemeanor offense under this chapter or under any statute of the United States or of any state relating to controlled substances or controlled substance analogs, narcotic drugs, marijuana or depressant, stimulant or hallucinogenic drugs.(5) This section does not apply if the person is presently charged with a felony under s. 961.41(3g) (c), (d), (e), or (g).1971 c. 219; 1985 a. 328; 1987 a. 339; 1989 a. 121; 1993 a. 98, 118, 482, 490; 1995 a. 402; 1995 a. 448 s. 288; Stats. 1995 s. 961.48; 1997 a. 35 ss. 340, 584; 1997 a. 220; 1999 a. 48; 2001 a. 109; 2003 a. 49. The trial court erred in imposing a second sentence on a defendant convicted of a second violation of ss. 161.41(1) (a) and 161.14(3) (k) [now ss. 961.41(1) (a) and 961.14(3) (k)]. While the repeater statute, s. 161.48 [now this section], allows imposition of a penalty not exceeding twice that allowable for a first offense, it does not of itself create a crime and cannot support a separate and independent sentence. Olson v. State, 69 Wis. 2d 605, 230 N.W.2d 634. For offenses under ch. 161 [now this chapter], the court may apply this section or s. 939.62, but not both. State v. Ray, 166 Wis. 2d 855, 481 N.W.2d 288 (Ct. App. 1992). In sentencing a defendant when the maximum sentence is doubled under this section, the court considers the same factors it considers in all sentencing, including prior convictions. State v. Canadeo, 168 Wis. 2d 559, 484 N.W.2d 340 (Ct. App. 1992). Sentencing under this section was improper when the defendant did not admit a prior conviction and the state did not offer proof of one. State v. Coolidge, 173 Wis. 2d 783, 496 N.W.2d 701 (Ct. App. 1993). Conviction under this section for a second or subsequent offense does not require proof of the prior offense at trial beyond a reasonable doubt. State v. Miles, 221 Wis. 2d 56, 584 N.W.2d 703 (Ct. App. 1998), 97-1364. A conviction for possessing drug paraphernalia under s. 961.573 qualifies as a prior offense under sub. (3). State v. Moline, 229 Wis. 2d 38, 598 N.W.2d 929 (Ct. App. 1999), 98-2176. A defendant convicted of a second or subsequent controlled substance offense is subject to the penalty enhancements provided for in both s. 939.62 and sub. (2) if the application of each enhancer is based on a separate and distinct prior conviction or convictions. State v. Maxey, 2003 WI App 94, 264 Wis. 2d 878, 663 N.W.2d 811, 02-1171.