It doesn't matter whether you purchase or cash advance. They are treated the same way. Your credit score will go lower initially whenever the balance increases. However, if you keep paying for the minimum payment or more every month, your score will go back higher gradually.
To improve your credit score, it is better to borrow and then pay off. If you don't borrow at all, it does not help your credit score.