To avoid any hassles at the border, carry a prescription that lists both the generic and brand name of the medication you're taking. If you need syringes, get a doctor's note that states why you need them. If you're arrested for a drug-related offence in the United States, don't expect any preferential treatment because you're Canadian. The U.S. justice systems are significantly different than the Canadian systems. For instance, each U.S. state has its own criminal code.
Sentences tend to be longer for many offences, including for crimes involving drugs.
As a foreigner, you may have trouble obtaining bail. Once you have been convicted of a criminal offence in the United States, you may be prevented from ever returning there. Choose your travelling companions wisely. Never cross the border with a hitchhiker or as a hitchhiker in a vehicle. Separate and meet on the other side.