Modifying e1071 package

Hi, I am working on improving the performance of naive bayes and want to add feature weight (using Kullback Leibler) in its formula. But I am not sure how to modify or rebuild e1071 package in R Studio and also is the estimation function in this package the right position to add the value weight?