Cosmetic fits the example sentence you give as a direct drop-in word, but it doesn't fit the description of your question or the second sentence in your question.
In other words, because of the way you've phrased your question, it's asking for something a bit different.
What is a word for using one word to replace another cosmetically?
to phrase or express (something) in a different way especially to make the meaning clearer · Let me rephrase the question.
Editors often use the word recasting for this purpose, one definition of which is simply "to present (something) in a different way."
Both of those words could actually suit your sentence if the sentence itself were changed slightly:
Despite the rephrasing of the law, nothing really changed.
In fact, using rephrasing (or recasting) in this slightly changed sentence would help with the use of despite (as mentioned in another answer).
Of course, you can change the meaning of something by rephrasing it significantly enough, but cosmetic changes are certainly not excluded.
More informally, there is another word that can imply minor (cosmetic) rephrasing of writing.
a small change or adjustment · We made a few tweaks to the original recipe.
Despite the tweaks to the law, nothing really changed.