Thanks
Unfortunately, there's not a simple answer to your question. There was no single "musket factory" that armed all the participants in the Thirty Years War, and so people were shooting at one another with different types of equipment. In general, the weapons were enormous, heavy things with a much larger caliber than we're used to today. They required a forked stake to steady the shooter's aim, and still produced massive recoil. Their effective range was roughly a hundred yards, but again let me stress that all kinds of conditions went into that figure. The quality of the black powder, the size of the actual projectile, the skill of the shooter, and the tactics of the battle all had an effect on the range. Modern-day reenactors tend to shoot at targets closer than a hundred yards.
Improvements in range could be had by changing a couple of things about the gun, all relating to the powder, the barrel, and the ball. If you use a ball closer in size to the diameter of the barrel (a tighter fit) then more of the gunpowder blast goes into pushing the ball out because the gas needs room to expand. If the powder is higher quality, there's less residue on the inside of the barrel and so the shots become more accurate. Certainly during the Thirty Years War and afterward, gunsmiths were capable of creating finely crafted weapons that functioned better all-around - but they were of course much more expensive. The main improvements during the time period that you mentioned have to do with lighter weapons that weren't as difficult to carry, and better firing mechanisms that were safer, faster, and more reliable.
Perhaps the largest improvement is the invention of rifling. Rifling is the process of cutting grooves into the inside of the barrel so that the ball spins as it exits, making the flight path more stable. These rifled firearms thus had to use tight-fitting projectiles because they needed to grip the walls of the barrel. But with the same amount of powder, the effective range of a rifle could be increased by a factor of two or three - again depending on the circumstances. Now, why didn't armies all switch to rifles? Firstly, rifles were more expensive. Second, they took much longer to load, because the tight-fitting bullet had to be forced down the barrel - sometimes with a hammer! And thirdly, it turned out that having some soldiers with rifles and some soldiers with muskets was more flexible than being limited to one or the other.
In the 17th C., an experienced formation of musketeers using either matchlocks or firelocks and using good gunpowder aimed at massed formations, is said to have had an effective range of between 4-600 yards.
Cromwell's Army by C H Firth (1903), pp. 89-90.
Keep in mind, at such ranges, the target was a large massed formation, not an individual.