The code provided was just an example that was supposed to illustrate that the htmlReplace function in the original setAbility code isn't being applied to anything other than the user feedback response. I'm sure that was just an oversight on Jakob's part, because he refers to setAbility as a "hack" of ChatSetAttr, which itself does have functioning HTML replacements. Unfortunately, for a non-coder such as myself, the syntax between the two scripts differs entirely too much for me to easily see where to correct that oversight. The very good reason that I have for using HTML replacements around attribute calls is because I'm packing them into a roll query and thus can't leave the |'s and }'s unaltered without breaking the roll query and the attributes are only being written to the sheet with setAbility, not being called for immediate use. If they get written without the HTML replacement happening though, then of course they're not going to function when the resulting ability is used. Perhaps this example will give you a better idea of what I'm doing: ?{Add Wild Shape stats for: |Giant Rat, !setability {{ --sel --replace --silent --GiantRat#\p{WS|GiantRat} \new!token~mod ~~set currentside\h?{Which side to use for Giant Rat?} --NewWSButton# [Giant Rat](\til@{selected|druid_name}|GiantRat) }} |GiantOwl, !setability {{ --sel --replace --silent --GiantOwl#\p{WS|GiantOwl} \new!token~mod ~~set currentside\h?{Which side to use for Giant Owl?} --NewWSButton# [Giant Owl](\til@{selected|druid_name}|GiantOwl) }} } So if the user selects Giant Owl, it will prompt them with "Which side to use for Giant Owl?" and after receiving that input it will then write (or overwrite) two abilities on their character sheet, one called GiantOwl which should read (assuming they entered 3 as the side to use): %{WS|GiantOwl} !token-mod --set currentside#3 And another called NewWSButton which should read: [Giant Owl](~@{selected|druid_name}|GiantOwl) Currently though, without the htmlReplace function being called, those abilities would get written as: %{WS|GiantOwl} !token-mod --set currentside#3 And: [Giant Owl](~@{selected|druid_name}|GiantOwl) Yes, I know that technically I don't have to use a roll query format to present those options, because I could set them all up as separate abilities on the character sheet named WS (which I'm obviously already going to be referencing) and then provide a series of button menus, but I prefer the roll query method for this because it means writing just one additional ability rather than 80-something ability fields to cover all of the beasts and elementals from the SRD-OGL. I imagine that a lot of text in a single ability field is lighter resource-wise than a similar amount of text spread among 80+ individual ability fields. In the end, in case it matters and isn't readily apparent, this is going to be part of a method for handling Druids' Wild Shape ability, but regardless of my ultimate goal, the problem I'd like help solving is the one presented in my original post: how can I get HTML replacement functionality properly working for setAbility?