An effort to enhance penalties associated with violent protests, create new crimes when mobs attack property or police and make it difficult for cities to trim law-enforcement spending had a rocky legislative debut, drawing heated criticism from opponents.