CYA can only be removed by draining water. So initially your test may have been in error. - unless you drained and refilled water. Maintain the CYA 40 if that is where you are today. No need to test CYA unless you have drained water.
If you have autofill and autodrain on your pool, it can be deceiving in that water will drain out if a lot of rain and be replaced with non-CYA water.
Focus on the SLAM with FC level of 16ppm. You should use liquid chlorine for a SLAM
Do NOT add chlorine pucks to a skimmer. it is best to put them in a floater in the pool. Depending on the type of pucks you will be adding CYA or Calcium to your pool. Be aware of that.
Please
Create Your Signature to help us understand what your current setup is and this will help responders to quickly see your equipment and pool details without having to keeping asking for the information.