S.C. Code Ann. § 62-7-413
(a) Except as otherwise provided in Subsection (b), if a particular charitable purpose becomes unlawful, impracticable, impossible to achieve, or wasteful:
(b) A provision in the terms of a charitable trust that would result in distribution of the trust property to a noncharitable beneficiary prevails over the power of the court under subsection (a) to modify or terminate the trust only if, when the provision takes effect: