It's in the file PokeBattle_SceneElements, in the class PokemonDataBox, around the end of the function refresh (I can't give you the precise line because I edited this code).
PS: a good tip for locating the code that handles some visual element, is to find the visual element in the Graphics folder (for battles, it should be in Graphics/Pictures/Battle), find the name of the file, and look for it in the scripts. Be careful not to include the extension though. For example, I located the code for statuses by looking for the file "icon_statuses" (which is in Graphics/Pictures/Battle).