It's been a long time since I touched anything KoTOR mod related, but I think it was mostly just trial and error. There was a formula to work out all the different numbers and whatever, but I've long since forgotten it. It will be on the forum somewhere though, if you search well enough.