Ex: My Stunfisk uses Camouflage and turns into a Water-Type, and then uses Muddy Water the next turn. Would Stunfisk receive STAB?
Your pokemon recieves STAB from its current type. Since stunfisk becomes a water type, he would gain STAB from using water attacks. However, he loses his original STAB.