first, get the <input> element of the password field
then, do the following with it:
pw_field.setAttribute('maxlength', 128);
i'm assuming you know how to get the element though.
if you know the id, its easy:
var pw_field = document.getElementById('pw_field_id')
if you dont know the id, you can loop through the inputs on the page:
var inputs = document.getElementsByTagName('input');
var pw_field;
for (var i = 0; i < inputs.length; i++) {
if (inputs[i].type == 'password') {
pw_field = inputs[i];
}
}