sigh... The Stormtrooper effect is something made up by fans but that is not how it actually is.
The way Star Wars canon works is that what happens in the movies is how it actually is. Even when not shooting at the heros the Stormtroopers are bad shots which BTW the offiical explinations is because the empire would buy cheap power crystals which made their weapons innacurate.
Not all blasters are powered by crystals it could also be powered by liquid or gas for the medium, a good portion of blasters use Tibanna Gas as the favored medium. I wouldn't say Stormtroopers were bad shots though, I mean they did kill all those Rebels aboard the Tantive IV, granted close range yes but Boba too was at a fairly close range.
Besides if Stormtroopers were such bad shots, then I doubt the Rebels wouldn't have lost every engagement they were in.