btw I temporarily solve it like this (since pa_color and pa_megethos are the only attributes I have)
jQuery("select[id^='pa_color']").each(function (i, el) {
let correct_id=jQuery(this).attr('id');
jQuery(this).parent().find('.wpcvs-terms').attr('data-attribute',correct_id);
});
jQuery("select[id^='pa_megethos']").each(function (i, el) {
let correct_id=jQuery(this).attr('id');
jQuery(this).parent().find('.wpcvs-terms').attr('data-attribute',correct_id);
});