unexpected T_FUNCTION in plugin template [closed]

EDIT

Undeleted my answer as the code seems to have helped the OP. Originally got beaten by @TomJNowell, so some content might be the same

ORIGINAL ANSWER

This is more PHP related than WordPress. Anonymous functions, the syntax used in the code given, was only introduced in PHP 5.3 and will not work in older versions. If you are sure that your client is using PHP 5.2, it is most probably the reason for the error.

You can just make a slight modification to the code to get it to work on older versions

add_filter('template_include', 'my_function_name', PHP_INT_MAX, 2 );
function my_function_name( $template ) {
 if(is_tax('hha_cats')){
  $template = dirname( __FILE__ ) . '/templates/category-hhavideo.php';
 }
 if( is_post_type_archive( 'hhavideo' ) ){
  $template = dirname( __FILE__ ) . '/templates/archive-hhavideo.php';
 }
 return $template;
 }