JavaScript replaceAll Regex Matches with translated character Code

I want to use the regex capture group to translate UTF-16 values in an ID.

var x = "ELEMENTT_x5F_GS1_x5F_MARKETING_x5F_CLAIM__x3B__INSTANCE_x3D_3__x3B__LOCALE_x3D_1_"
var regex = /_(x..)_/g;
var replacedID = x.replaceAll(regex, String.fromCodePoint("0" + "$1"));

however this does not appear to fill in the captured value into the string the same way it normally works.
i have tried any which way and it does not seem to recognize the “$1” as replace capture group.