As I mentioned earlier, the gunpowder advance is the TRIGGER to activate the musketeer slot effect.
If gunpowder is not discovered by anyone - it doesn't matter what is in the musketeer slot, there will be no effect.
If there the musketeer slot is empty, there is of course no effect irrespective of whether gunpowder has been developed.
There. I hope that makes everything crystal clear. (except I am not clear what happens if only AAA discovers gunpowder but it is only BBB who can build the musketeer unit, it doesn't really matter, just always remove gunpowder from the tech tree).
As for the Knight effect, there is NO trigger advance so the effect begins as soon as the unit in the Knight slot is buidable.