Rasmus said:
Oosh, the wizard of macros!
I succeeded with changing the { and }, here is the final code:
@{selected|wtype}&{template:spell} {{level=abjuration 3}} {{name=Counterspell}} {{castingtime=1 reaction, which you take when you see a creature within 60 feet of you casting a spell}} {{range=60 feet}} {{target=A creature in the process of casting a spell}} 0 {{s=1}} 0 {{material=}} {{duration=Instantaneous}} {{description=You attempt to interrupt a creature in the process of casting a spell. If the creature is casting a spell of 3rd level or lower, its spell fails and has no effect. If it is casting a spell of 4th level or higher, make an [ability check](!@{selected|wtype}} #&{template:npcaction}} {{name=@{selected|npc_name}}} {{rname=Counterspell}} {{description=*Ability:* [[1d20+@{selected|intelligence_mod}[SPELL] ]] }}) using your spellcasting ability. The DC equals 10 + the spell’s level. On a success, the creature’s spell fails and has no effect. At Higher Levels. When you cast this spell using a spell slot of 4th level or higher, the interrupted spell has no effect if its level is less than or equal to the level of the spell slot you used.}} {{athigherlevels=}} 0 {{innate=}} 0 @{selected|charname_output}
I have tested the macro on multiple NPCs and one error continuesly occur. It doesn't matter, whether the NPC sheet is set to 'Never whisper rolls' or 'Always whisper rolls', when I click the pink box it will not follow the selected tokens whisper-preferences and always be visible for everyone in chat. Can you fix this?

Sorry thats on my, the whisper type needs to go after the " ":
@{selected|wtype}&{template:spell} {{level=abjuration 3}} {{name=Counterspell}} {{castingtime=1 reaction, which you take when you see a creature within 60 feet of you casting a spell}} {{range=60 feet}} {{target=A creature in the process of casting a spell}} 0 {{s=1}} 0 {{material=}} {{duration=Instantaneous}} {{description=You attempt to interrupt a creature in the process of casting a spell. If the creature is casting a spell of 3rd level or lower, its spell fails and has no effect. If it is casting a spell of 4th level or higher, make an [ability check](! @{selected|wtype}#&{template:npcaction}} {{name=@{selected|npc_name}}} {{rname=Counterspell}} {{description=*Ability:* [[1d20+@{selected|intelligence_mod}[SPELL] ]] }}) using your spellcasting ability. The DC equals 10 + the spell’s level. On a success, the creature’s spell fails and has no effect. At Higher Levels. When you cast this spell using a spell slot of 4th level or higher, the interrupted spell has no effect if its level is less than or equal to the level of the spell slot you used.}} {{athigherlevels=}} 0 {{innate=}} 0 @{selected|charname_output}
I don't know how to keep the whisper type and lose the button formatting like the example below but that is a huge discovery Oosh!! Nice find:
Interesting... changing the syntax at the start, you can get a working button with no styling on it:
[Button](`#@{selected|wtype} &{template:npcaction} {{name=@{selected|npc_name}}} {{rname=Counterspell}} {{description=*Ability:* [[1d20+@{selected|intelligence_mod}[SPELL] ]]}})