As far as I know referencing another scripted field inside a scripted field will most likely fail due to the face there is no priority in computing the scripted fields so you don't always have the field present when trying to compute the other one.
I would consider moving both calculations inside one single scripted field and do it from there.
You can get some examples and best practices over here (even examples on using Java native types):
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.