You can't change the max/min ranges of an input in roll20, you need to use other stats as a step between to adjust the final value.
Have something like this.
<input name="attr_test" class="faimtest" type="number" min="0" value="100">
<input name="attr_test_max" class="faimtest" type="number" min="0" value="100">
<input name="attr_rangefinal" class="faimtest" type="range" min="0" value="100" max="100">
<script type="text/worker">
on("change:test change:test_max, function() {
getAttrs(["test","test_max"], function(values) {
let test = parseInt(values.test)||0;
let testmax = parseInt(values.test_max)||0;
let rangefinalnew = (test/test_max)*100;
setAttrs({
"rangefinal": rangefinalnew
});
});
});
</script>
Then make a sheetworker that changes changes the rangefinal by calculating (test/test_max)*100.
You have to read the docs and examples to figure it out if my example code is wrong, but it should be in the right direction https://wiki.roll20.net/Sheet_Worker_Scripts
If both test & test_max have same value, rangefinal will be set to 100, showing it being full.