This is not possible in the old gbm but I recently wrote a function to calculate it. It can yield very different results for the most important variables for different classes. See this question and my answer for the code
Hopefully you would just need to translate this from my dplyr/purrr version to base to implement it. If it doesn't make sense to do this this way please let me know!